package com.example.teamilkmall.service.Impl;

import com.example.teamilkmall.entity.FacadeInfo;
import com.example.teamilkmall.mapper.FacadeInfoMapper;
import com.example.teamilkmall.service.FacadeInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("facadeInfoService")
public class FacadeInfoServiceImpl implements FacadeInfoService {

    private final FacadeInfoMapper facadeInfoMapper;

    public FacadeInfoServiceImpl(FacadeInfoMapper facadeInfoMapper) {
        this.facadeInfoMapper = facadeInfoMapper;
    }


    @Override
    public PageInfo<FacadeInfo> listFacadeInfo(Integer pageSize, Integer pageNum, String name) {
        List<FacadeInfo> list = facadeInfoMapper.listFacadeInfo(pageSize,pageNum,name);
        PageInfo<FacadeInfo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public List<FacadeInfo> listFacadeInfoAll() {
        return facadeInfoMapper.listFacadeInfoAll();
    }

    @Override
    public void updateFacadeInfo(FacadeInfo facadeInfo) {
        facadeInfoMapper.updateFacadeInfo(facadeInfo);
    }

    @Override
    public void deloneFacadeInfo(Integer id) {
        facadeInfoMapper.deloneFacadeInfo(id);
    }

    @Override
    public void addFacadeInfo(FacadeInfo facadeInfo) {
        facadeInfoMapper.addFacadeInfo(facadeInfo);
    }
}
